/*
 * @Author: 李超越 1509572300@qq.com
 * @Date: 2024-08-31 11:53:31
 * @LastEditors: 李超越 1509572300@qq.com
 * @LastEditTime: 2024-08-31 11:53:37
 * @FilePath: /my_git/lesson31_thread_Pool/Task.hpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma once

#include <iostream>
#include <string>
#include <functional>

// 任务类型
// using Task = std::function<void()>;

class Task
{
public:
    Task() {}
    Task(int a, int b) : _a(a), _b(b), _result(0)
    {
    }
    void Excute()
    {
        _result = _a + _b;
    }
    std::string ResultToString()
    {
        return std::to_string(_a) + "+" + std::to_string(_b) + "=" + std::to_string(_result);
    }
    std::string DebugToString()
    {
        return std::to_string(_a) + "+" + std::to_string(_b) + "=?";
    }
    void operator()()
    {
        Excute();
    }

private:
    int _a;
    int _b;
    int _result;
};
